package time;

import java.time.LocalTime;

/**
 * 时间相关测试
 */
public class LocalTimeTest {
    public static void main(String[] args) {
        now();
        customTime();
        timeInfo();
    }

    private static void timeInfo() {
        LocalTime now = LocalTime.now();
        System.out.println("now.getHour() = " + now.getHour());
        System.out.println("now.getMinute() = " + now.getMinute());
        System.out.println("now.getSecond() = " + now.getSecond());
        System.out.println("now.getNano() = " + now.getNano());
    }

    private static void customTime() {
        LocalTime time = LocalTime.of(13, 13, 2);
        System.out.println("time = " + time);
    }

    private static void now() {
        LocalTime now = LocalTime.now();
        System.out.println("now = " + now);
    }
}
